home *** CD-ROM | disk | FTP | other *** search
- Path: solon.com!not-for-mail
- From: seebs@solutions.solon.com (Peter Seebach)
- Newsgroups: comp.lang.c
- Subject: Re: char* still alive after free ???
- Date: 16 Apr 1996 07:36:39 -0500
- Organization: Usenet Fact Police (Undercover)
- Message-ID: <4l048n$g3u@solutions.solon.com>
- References: <317269EA.11BB93C2@studbox.uni-stuttgart.de> <829591931snz@genesis.demon.co.uk> <4kvgb4$3vt@nervous.pdb.sni.de>
- Reply-To: seebs@solon.com
- NNTP-Posting-Host: solutions.solon.com
-
- In article <4kvgb4$3vt@nervous.pdb.sni.de>,
- Josef Moellers <mollers.pad@sni.de> wrote:
- >In <829591931snz@genesis.demon.co.uk> Lawrence Kirby <fred@genesis.demon.co.uk> writes:
-
- >>>free(text); text=NULL; and finally a
-
- >>The text = NULL; is redundant.
-
- >It's NOT redundant! It would be if "free(text)" would set "text" to
- >NULL, but since arguments are passed by value in C, this is unlikely.
-
- There's an implementation where it does, apparently.
-
- The reason he said it was redundant is that the very next line of the
- original code assigned to text; two successive assignments can safely
- be assumed redundant, if the variable assigned to isn't volatile.
-
- -s
- --
- Peter Seebach - seebs@solon.com - Copyright 1996 Peter Seebach.
- C/Unix wizard -- C/Unix questions? Send mail for help. No, really!
- Unsolicited email is not welcome, and will be billed for at consulting rates.
- The *other* C FAQ - http://www.solon.com/~seebs/c/c-iaq.html
-